//
//  AYMHomeMenuBtn.m
//  QuickCure
//
//  Created by 徐绩 on 16/5/4.
//  Copyright © 2016年 ayumi. All rights reserved.
//

#import "AYMHomeMenuBtn.h"

@implementation AYMHomeMenuBtn

-(instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        
        [self setupUI];
    }
    return self;
}

-(void)setupUI{

    [self setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    self.titleLabel.font = [UIFont systemFontOfSize:homeFont];
    self.imageView.contentMode = UIViewContentModeCenter;
    self.titleLabel.textAlignment = NSTextAlignmentCenter;
    [self sizeToFit];
}

-(void)layoutSubviews{

    [super layoutSubviews];
    
    self.imageView.center = CGPointMake(self.frame.size.width/2, self.imageView.frame.size.height);

    self.titleLabel.bounds = CGRectMake(0, 0, self.frame.size.width, self.frame.size.height - self.imageView.frame.size.height);
    self.titleLabel.center = CGPointMake(self.frame.size.width/2, CGRectGetMaxY(self.imageView.frame) + 20);
    
}

@end
